package com.pan.crawler.factory;

import com.pan.crawler.factory.conf.HeaderConfig;
import jdk.nashorn.internal.runtime.options.Options;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

import java.util.List;

public class EdgeDriverFactory implements DriverFactory {


    @Override
    public WebDriver getDriver(){
        EdgeOptions edgeOptions = new EdgeOptions();
        List<String> headerList = HeaderConfig.INSTANCE.getHeaderList();
        headerList.forEach(args->edgeOptions.addArguments(args));
        WebDriver driver = new EdgeDriver(edgeOptions);
        return driver;
    }

}
